import { ALL_ROUTES } from "@/config/routerConstant";
import { RouteLocationNormalizedLoaded } from "vue-router";

const RoleIndex = () => import("@page/role/index/index.vue");
const RoleDetail = () => import("@page/role/detail/index.vue");

export const ROLE_ROUTES = [
  {
    path: ALL_ROUTES.ROLE_INDEX.path,
    component: RoleIndex,
    name: ALL_ROUTES.ROLE_INDEX.name,
    meta: {
      title: ALL_ROUTES.ROLE_INDEX.title,
    },
  },
  {
    path: ALL_ROUTES.ROLE_DETAIL.path,
    component: RoleDetail,
    name: ALL_ROUTES.ROLE_DETAIL.name,
    meta: {
      title: ALL_ROUTES.ROLE_DETAIL.title,
    },
    props: (route: RouteLocationNormalizedLoaded) => ({
      roleId: route.params.roleId,
      roleid1: route.query.roleid1,
    }),
  },
];
